JBoss Community Archive (Read Only)

GateIn Portal 3.7

Spring Framework Portlet Development

Please note that our support for Spring Portlet MVC is limited. While making our best to make sure that the portlet will work as gracefully as in other portal solutions, we are not able to provide a patch for any Spring component in case there is a bug uncovered in it. We were able to test Spring in portlets successfully and we know of a few successful deployments by GateIn users.

You may want to consider other fully supported options such as JSP, JSF or JSF with RichFaces to replace Spring Portlet MVC.

Developing a Spring Portlet

Please refer to Portlet MVC Framework section of Spring Framework Reference Documentation for a detailed instructions how to set up a Spring based portlet project. The use of other Spring components should be carefully evaluated as they may or may not work in the Portal environment.

When generating an Action URL using the portlet tag library, ensure that you include escapeXml="false" in the definition of portlet:actionURL, such as the example below. If you don't, you may experience page not found issues as it is unable to map the URL to a Spring controller.

<portlet:actionURL var="myAction" escapeXml="false" />

Spring 2.5

When developing, or migrating, a Spring portlet on version 2.5 for GateIn the following configuration will fail to locate the beans to be scanned:

<context:component-scan base-package="org.blah"/>

This limitation is because Spring 2.5 can not interpret the VFS file system that JBoss AS uses, and is therefore unable to scan the jars to find the beans. This limitation is not present in Spring 3.x versions.

Resolving the inability to scan for Spring beans is simply a matter of removing the above component-scan tag and specifying bean tags for each bean required.

Ajax and Spring 2.5

Spring 2.5 only supports JSR 168 (Portlet Spec 1.0), it does not include support for ResourceRequest which was introduced by JSR 286 (Portlet Spec 2.0).

Without the ability to use a ResourceRequest, the means by which Ajax calls are handled in a portlet, it is not possible to use Ajax calls with a Spring 2.5 portlet. If your portlet needs to use Ajax calls, it needs to be upgraded to Spring 3.x.

Deploying a Spring Portlet

Deploying a Spring based portlet, importing it and adding it to a page is the very same process as with any other portlet.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 13:09:55 UTC, last content change 2013-09-18 13:29:16 UTC.